//
//  recordMenuButton.m
//  SoundPill
//
//  Created by 宋旭东 on 16/5/15.
//  Copyright © 2016年 宋旭东. All rights reserved.
//

#import "recordMenuButton.h"

@implementation recordMenuButton
- (instancetype)initWithFrame:(CGRect)frame image:(UIImage *)image title:(NSString *)title
{
    self = [super initWithFrame:frame];
    if (self) {
        _titleImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.height, frame.size.height)];
        _titleImage.image = image;
        [self addSubview:_titleImage];
        CGPoint point = _titleImage.center;
        _titleImage.frame = CGRectMake(0, 0, frame.size.height - 15, frame.size.height - 15);
        _titleImage.center = CGPointMake(point.x + 10, point.y);
        _titleContent = [[UILabel alloc] initWithFrame:CGRectMake(frame.size.height, 0, frame.size.width - frame.size.height, frame.size.height)];
        _titleContent.textColor = [UIColor whiteColor];
        _titleContent.text = title;
        _titleContent.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_titleContent];
    }
    return self;
}
@end
